package com.youpai.platform.biggod.service.mapper;

import com.youpai.platform.biggod.service.entity.po.CategoryPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryMapper {

    //新增类别
    public Integer add(CategoryPO categoryPO);

    //更新类别
    public Integer update(CategoryPO categoryPO);

    //通过ID获取类别信息
    public CategoryPO get(Long categoryId);

    //通过名称获取类别信息
    public List<CategoryPO> getByName(
            @Param(value = "keyword") String keyword,
            @Param(value = "offset") Integer offset,
            @Param(value = "length") Integer length);

    // 数据条数
    public Integer countItem(@Param(value = "keyword") String keyword);

    //删除类别列表
    public Integer remove(
            @Param(value = "categoryIds") List<Long> categoryIds);

    //从数据库中物理删除，仅用于测试
    public Integer delete(Long categoryId);
}
